//????
#include <REGX52.H>
sbit R_P=PSW^0;
 
unsigned char Receive()//???????
{
	unsigned char dat;
	while(RI==0);//??RI,RI=0,????
	RI=0;					//??????RI???0
	ACC=SBUF;			//???????????ACC
	if(RB8=R_P) 	//?????????????,????
	{
		dat=ACC;		//?ACC????dat
		return dat;	//????????
	}
}
 
void main()
{
	TMOD=0x20;  //????????2,8?????
	SCON=0xd0;	//?????3,????REN=1
	PCON&=0x7f;	//??????
	TH1=0xfd;		//???9600
	TL1=0xfd;
	TR1=1;
	//REN=1;
	while(1)
	{
		 P2=Receive();	//????????P2???
	}
}